{	Problem: http://codeforces.ru/problemset/problem/47/A
	Verdict: Accepted

}
var n,i,cur:longint;
begin
readln(n);
i:=1;
cur:=1;
while i<n do begin
  inc(cur);
  inc(i,cur);
end;
if i=n then writeln('YES') else writeln('NO');
readln;
end.
